/*
author:杨文超
email:yangwenchao@keynection.cn
*/
#include "mbconfig.h"

#pragma once

#ifdef __cplusplus
extern "C" {
#endif


#define MB_SER_PDU_SIZE_MIN     4       /* Minimum size of a Modbus RTU frame. */


eMBErrorCode    eMBMasterRTUInit( UCHAR ucPort, ULONG ulBaudRate,eMBParity eParity );
void            eMBMasterRTUStart( void );
void            eMBMasterRTUStop( void );
eMBErrorCode    eMBMasterRTUReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, USHORT * pusLength );
eMBErrorCode    eMBMasterRTUSend( UCHAR slaveAddress, const UCHAR * pucFrame, USHORT usLength );
BOOL            xMBMasterRTUReceiveFSM( void );
BOOL            xMBMasterRTUTransmitFSM( void );
BOOL            xMBMasterRTUTimerExpired( void );


#ifdef __cplusplus
}
#endif
